package net.sunofbeaches.controller.portal;

import net.sunofbeaches.response.ResponseResult;
import net.sunofbeaches.services.CategoryService;
import net.sunofbeaches.services.FriendLinkService;
import net.sunofbeaches.services.ILoopService;
import net.sunofbeaches.services.WebSizeInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/protal/web_size_info")
public class WebSizeInfoPortalApi {
    @Autowired
    ILoopService iLoopService;
    @Autowired
    CategoryService categoryService;
    @Autowired
    FriendLinkService friendLinkService;
    @Autowired
    WebSizeInfoService webSizeInfoService;

    /**
     * 获取分类列表成功
     *
     * @return
     */
    @GetMapping("/categories")
    public ResponseResult getCategories(){
        return categoryService.listCategories();
    }

    /**
     * 获取网站title成功
     *
     * @return
     */
    @GetMapping("/title")
    public ResponseResult getWebSizeTitle(){
        return webSizeInfoService.getWebSizeTitle();
    }

    /**
     * 获取网站浏览量成功.
     *
     * @return
     */
    @GetMapping("/view_count")
    public ResponseResult getWebSizeViewCount(){
        return webSizeInfoService.getSizeViewCount();
    }

    /**
     * 获取SEO信息成功
     *
     * @return
     */
    @GetMapping("/seo")
    public ResponseResult getWebSizeSeoInfo(){
        return webSizeInfoService.getSeoInfo();
    }
    @GetMapping("/loop")
    public ResponseResult getLoops(){
        return iLoopService.listLoops();
    }

    /**
     * 友情链接
     *
     * @return
     */
    @GetMapping("/friend_link")
    public ResponseResult getLinks(){
        return friendLinkService.listFriendLinks();
    }
}
